package com.suixun.util.enums;

public enum GalleryEnum {

	ZHUANGBAN(14,"装扮"), JUJIA(19, "居家"), MEIZHUANG(17, "美妆"), LINGSHI(18, "零食"), HAOWANER(15, "好玩儿");

	private String name;

	private int id;

	public static String[] ORDER_NAMES = new String[] { ZHUANGBAN.name,
		JUJIA.name, MEIZHUANG.name, LINGSHI.name, HAOWANER.name };

	private GalleryEnum(int id, String name) {
		this.id = id;
		this.name = name;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public static String getNameById(int id) {
		for (GalleryEnum g : GalleryEnum.values()) {
			if (g.getId() == id) {
				return g.getName();
			}
		}
		return "";
	}

	public static int getIdByName(String name) {
		for (GalleryEnum g : GalleryEnum.values()) {
			if (g.getName().equals(name)) {
				return g.getId();
			}
		}
		return 0;
	}

}
